'''
作者: 沙昊
邮箱: shahao@zju.edu.cn
功能: 
包含算法: 
Copyright (c) 2023 by 沙昊, All Rights Reserved. 
'''

sha_dict = {"!":{"!":0,"@":13,"#":4 },
            "@":{"!":13, "@":7, "#":20 },
            "#":{"#":5,"@":20, "!":4},
                }

def my_solution():

    n = int(input())
    num_list = input().split("+")
    num1 = list(num_list[0])
    num2 = list(num_list[1])
    if num1.count(".")==0:
        sha_in1 = len(num1)-1
    else:
        sha_in1 = num1.index(".")


    map_code = []
    for i,temp_char in enumerate(num1):
        if temp_char in ["#","@","!"]:
            map_code.append([sha_in1-i,temp_char])
            num1[i] = "0"
         
    i = 0

    for j,temp_char in enumerate(num2):
        if temp_char in ["#","@","!"]:
            map_code[i].append(temp_char)
            num2[j] = "0"
            i +=1

    num1 = float(''.join(num1))
    num2 = float(''.join(num2))
    
    result = num1+num2

    sha_plus = 0
    for sha_index,c1,c2 in map_code:
        sha_plus += sha_dict[c1][c2]*(10**sha_index)


    result += sha_plus
    print(result)

    return result





if __name__ == "__main__":
    my_result = my_solution()
    # print(my_result)